package sh.orm;

import sh.base.config.ConfigManager;

/**
 * orm中配置挂历器的初始者
 * 由于有多个地方都要使用ConfigManager,但是都是同样的内容
 * @author lqq
 * @date 2019/2/28
 */
public class ConfigManagerInitiator {

    private static ConfigManager configManager;

    private static ConfigManagerInitiator instance;

    public ConfigManager getConfigManager(){

        return configManager;
    }

    private ConfigManagerInitiator(){

    }

    public static ConfigManagerInitiator getInstance(){
        if(instance != null){
            return instance;
        }
        synchronized (ConfigManagerInitiator.class){
            if (instance == null){
                instance = new ConfigManagerInitiator();
                configManager = new ConfigManager();
                configManager.init("orm.properties");
            }
        }
        return instance;
    }



}
